<?php

include_once("root.php");
include_once($ROOT . "base.inc.php");

$html = "";
$div = "contentdiv";

if (array_key_exists('content', $_GET))
{
  $html = $_GET['content'];
}

if (array_key_exists('div', $_GET))
{
  $div  = $_GET['div'];
}

if (array_key_exists('action', $_GET))
{
	$args = array();
	foreach ($_GET as $key => $value)
	{
		if ($key != 'action' && $key != 'div' && $key != 'content')
		{
			$args[$key] = $value;
		}
	}
	$html = get_ajax_contents("asynch.php", $_GET['action'], $args);
	$html = str_replace("'", "\'", $html);
}

?>

div = document.getElementById('<?php echo $div ?>');
div.innerHTML = '<?php echo $html; ?>';
